<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>资料录入</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="/static/wx/lib/sui/sm.min.css">
    <link rel="stylesheet" href="/static/wx/lib/sui/sm-extend.min.css">
    <link rel="stylesheet" href="/static/wx/css/reset.css">
    <link rel="stylesheet" href="/static/wx/css/main.css">
    <link rel="stylesheet" href="/static/wx/css/public_main.css">
</head>
<body>
    <div class="page-group">
        <div class="page page-current" id="filerecord">

            <!-- 主内容 -->
            <div class="content">
                <div class="setp-card">
                    <div class="step-box">
                        <div class="step-item selected">
                            <div class="step-item-line">
                                <span></span>
                            </div>
                            <div class="step-item-text size-65">保单险种</div>
                        </div>
                        <div class="step-item selected">
                            <div class="step-item-line">
                                <span></span>
                            </div>
                            <div class="step-item-text size-65">货品信息</div>
                        </div>
                        <div class="step-item selected">
                            <div class="step-item-line">
                                <span></span>
                            </div>
                            <div class="step-item-text size-65">货品受损</div>
                        </div>
                        <div class="step-item selected">
                            <div class="step-item-line">
                                <span></span>
                            </div>
                            <div class="step-item-text size-65">货品现状</div>
                        </div>
                        <div class="step-item selected">
                            <div class="step-item-line">
                                <span></span>
                            </div>
                            <div class="step-item-text size-65">物权信息</div>
                        </div>
                        <div class="step-item">
                            <div class="step-item-line">
                                <span></span>
                            </div>
                            <div class="step-item-text size-65">递交授权</div>
                        </div>
                    </div>
                    <div class="size-65 text-c">
                        以下资料作为法律责任依据请如实填写，<span class="blue">查看模版>></span>
                    </div>
                </div>
                <div class="bs-box">
                    <div class="bs-box-content">
                        <div class="bs-box-inner">
                            <div class="bs-box-content-item width-link size-m">
                                <div>要求在</div>
                                <div>
                                    <input placeholder="请选择时间"  id="should_at" value="{if isset($info.should_at)}{$info.should_at|substr=0,10}{/if}"/>
                                </div>
                                <div>处置完成</div>
                            </div>
                            <div class="bs-box-content-item">
                                <p class="size-m">物权单位</p>
                                <div>
                                    <input class="size-m" type="text" placeholder="请填写单位名称"  name="rem_company"  value="{if isset($info.rem_company)}{$info.rem_company}{/if}"/>
                                </div>
                            </div>
                            <div class="bs-box-content-item">
                                <p class="size-m">联系人</p>
                                <div>
                                    <input class="size-m" type="text" placeholder="请填写联系人名称" name="linkman" value="{if isset($info.linkman)}{$info.linkman}{/if}"/>
                                </div>
                            </div>
                            <div class="bs-box-content-item">
                                <p class="size-m">手机号</p>
                                <div>
                                    <input class="size-m" type="text" placeholder="请填写手机号"  name="connect_phone" value="{if isset($info.connect_phone)}{$info.connect_phone}{/if}"/>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <input type="hidden" value="{$policy_num}" name='policy_num'/>
                <div class="btn-box" style="margin-top: 1rem;">
                    <div class="flex">
                        <div class="pre-step my-btn" style="width:47%;" @click="preStep" id="preStep">
                            <span style="background-color: #fff;color:#000;">上一步</span>
                        </div>
                        <div class="pre-step my-btn" style="width:47%" @click="nextStep" id="nextStep">
                            <span class="active">下一步</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
    </div>
    <script type='text/javascript' src='/static/wx/lib/sui/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/wx/lib/sui/sm.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/wx/lib/sui/sm-extend.min.js' charset='utf-8'></script>
    <script>
       $(function () {
            var myDate = new Date();
            var year = myDate.getFullYear();//获取年
            var month = myDate.getMonth() + 1;////获取月
            var day = myDate.getDate();//获取日
            if (month < 10) month = "0" + month;
            if (day < 10) day = "0" + day;
            var time = year + "-" + month + "-" + day;
            $("#should_at").calendar({
                value: [time],
            });
            var n = $('.step-box').children().length;
            $('.step-item').css('width', document.body.clientWidth / n + 'px')
            $(document).on('click', '#preStep', function () {
                var poliecy = $("input[ name='policy_num']").val();
                location.href = "{:url('insurer/step4')}?policy_num=" + poliecy;
            });
            $(document).on('click', '#nextStep', function () {
                var poliecy = $("input[ name='policy_num']").val();
                var should_at = $("#should_at").val()
                var rem_company = $("input[ name='rem_company']").val();
                var linkman = $("input[ name='linkman']").val();
                var connect_phone = $("input[ name='connect_phone']").val();
                $.ajax({
                    type: 'POST',
                    url: "{:url('insurer/addInsurer')}",
                    data: {
                        'policy_num': poliecy,
                        'should_at': should_at,
                        'rem_company': rem_company,
                        'linkman': linkman,
                        'connect_phone': connect_phone,
                        'now_status': 5
                    },
                    dataType: 'json',
                    success: function (Json) {
                        console.log(Json);
                        if (Json.code == 200) {
                            location.href = "{:url('insurer/step6')}?policy_num=" + Json.data.policy_num;
                        } else {
                            $.alert(Json.msg);
                        }
                    }
                });
            });
           $(document).on('click', '.blue', function () {
               location.href="{:url('index/test5')}"
           })
       });

    </script>
</body>

</html>